package com.example.mybatisplus.service.impl;

import com.example.mybatisplus.mapper.RegisterMapper;
import com.example.mybatisplus.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    RegisterMapper registerMapper;

    @Override
    public int register(String stu_name,int sex,String phone,String stu_username, String stu_password,int age) {
        return registerMapper.addUser(stu_name,sex,phone,stu_username,stu_password,age);
    }

    @Override
    public boolean queryUser(String stu_username) {
        String user = registerMapper.queryUser(stu_username);
        return user != null;
//        if(stu_username == registerMapper.queryUser(stu_username)){
//            return false;
//        }else {
//            return true;
//        }
    }
}
